/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package th.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "sej_katalaluan")
@NamedQueries({
    @NamedQuery(name = "SejarahKatalaluan.findAll", query = "SELECT s FROM SejarahKatalaluan s")})
public class SejarahKatalaluan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_sej_katalaluan")
    private Integer idSejKatalaluan;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "id_pguna")
    private Pengguna pengguna;    
        
    @Column(name = "katalaluan_lama1")
    private String kataLaluanLama1;
    
    @Column(name = "katalaluan_lama2")
    private String kataLaluanLama2;
    
    @Column(name = "katalaluan_lama3")
    private String kataLaluanLama3;
    
    @Embedded
    private InfoAudit infoAudit;


    public SejarahKatalaluan() {
    }
    
    public SejarahKatalaluan(SejarahKatalaluan sk) {
    }

    public SejarahKatalaluan(Integer idSejKatalaluan) {
        this.idSejKatalaluan = idSejKatalaluan;
    }

    public Integer getIdSejKatalaluan() {
        return idSejKatalaluan;
    }

    public void setIdSejKatalaluan(Integer idSejKatalaluan) {
        this.idSejKatalaluan = idSejKatalaluan;
    }

    public Pengguna getPengguna() {
        return pengguna;
    }

    public void setPengguna(Pengguna pengguna) {
        this.pengguna = pengguna;
    }      

    public String getKataLaluanLama1() {
        return kataLaluanLama1;
    }

    public void setKataLaluanLama1(String kataLaluanLama1) {
        this.kataLaluanLama1 = kataLaluanLama1;
    }

    public String getKataLaluanLama2() {
        return kataLaluanLama2;
    }

    public void setKataLaluanLama2(String kataLaluanLama2) {
        this.kataLaluanLama2 = kataLaluanLama2;
    }

    public String getKataLaluanLama3() {
        return kataLaluanLama3;
    }

    public void setKataLaluanLama3(String kataLaluanLama3) {
        this.kataLaluanLama3 = kataLaluanLama3;
    }
    

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }


    @Override
    public int hashCode() {
        int hash = 7;
        hash = 53 * hash + (this.idSejKatalaluan != null ? this.idSejKatalaluan.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final SejarahKatalaluan other = (SejarahKatalaluan) obj;
        if (this.idSejKatalaluan != other.idSejKatalaluan && (this.idSejKatalaluan == null || !this.idSejKatalaluan.equals(other.idSejKatalaluan))) {
            return false;
        }
        return true;
    }
    
    @Override
    public String toString() {
           return "th.model.SejarahKatalaluan[ idSejKatalaluan=" + idSejKatalaluan + " ]";
    }
    
}
